Code cleanup.
authorOwen Taylor <otaylor@redhat.com>
Thu, 21 Jan 1999 21:06:13 +0000 (21:06 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Thu, 21 Jan 1999 21:06:13 +0000 (21:06 +0000)
Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>

* gtk/gtkbutton.c (gtk_button_expose): Code cleanup.

* gtk/gtktree.c: Add a paint routine, fix up bugs
in drawing where if the expose area was contained
completely in the right side of the tree the background
wasn't redraw, etc.

* gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
in clipping draw regions while propagating them
upwards.

gtk/gtkbutton.c
gtk/gtkwidget.c

index 44475d64fe20ceb8c38a8993bf0eed4227788217..60e6dbf661bd0781ba2faf5ca00b432f91650e9c 100644 (file)
@@ -636,7 +636,7 @@ static gint
 gtk_button_expose (GtkWidget      *widget,
                   GdkEventExpose *event)
 {
-  GtkButton *button;
+  GtkButton *bin;
   GdkEventExpose child_event;
 
   g_return_val_if_fail (widget != NULL, FALSE);
@@ -645,14 +645,14 @@ gtk_button_expose (GtkWidget      *widget,
 
   if (GTK_WIDGET_DRAWABLE (widget))
     {
-      button = GTK_BUTTON (widget);
+      bin = GTK_BIN (widget);
       
       gtk_button_paint (widget, &event->area);
 
       child_event = *event;
-      if (GTK_BIN (button)->child && GTK_WIDGET_NO_WINDOW (GTK_BIN (button)->child) &&
-         gtk_widget_intersect (GTK_BIN (button)->child, &event->area, &child_event.area))
-       gtk_widget_event (GTK_BIN (button)->child, (GdkEvent*) &child_event);
+      if (bin->child && GTK_WIDGET_NO_WINDOW (bin->child) &&
+         gtk_widget_intersect (bin->child, &event->area, &child_event.area))
+       gtk_widget_event (bin->child, (GdkEvent*) &child_event);
     }
 
   return FALSE;
index 5bb11e08f8f5133021c1a8bbcd760e048f8c39c9..b73581e959b3bbb2db7f44b3f1e334195a634612 100644 (file)
@@ -1971,12 +1971,12 @@ gtk_widget_clip_rect (GtkWidget *widget,
       
       if (rect->x < 0)
        {
-         rect->width = (width > -rect->x) ? width + rect->x : 0;
+         rect->width = (rect->width > -rect->x) ? rect->width + rect->x : 0;
          rect->x = 0;
        }
       if (rect->y < 0)
        {
-         rect->height = (height > -rect->y) ? width + rect->y : 0;
+         rect->height = (rect->height > -rect->y) ? rect->width + rect->y : 0;
          rect->y = 0;
        }
       if (rect->x + rect->width > width)